package leetcode_800;

import java.util.Arrays;

/**
 *@author 周杨
 *DesignHashMap_706 实现hashmap 
 *describe:用数组 AC 30%
 *2018年10月11日 上午10:19:24
 */
public class DesignHashMap_706 {
	int hash[];
	/** Initialize your data structure here. */
    public DesignHashMap_706() {
        this.hash=new int[1000001];
        Arrays.fill(hash, -1);
    }
    
    /** value will always be non-negative. */
    public void put(int key, int value) {
        this.hash[key]=value;
    }
    
    /** Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key */
    public int get(int key) {
        return this.hash[key];
    }
    
    /** Removes the mapping of the specified value key if this map contains a mapping for the key */
    public void remove(int key) {
        this.hash[key]=-1;
    }
}
